/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity.MRP.ProductionPlan;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.OneToMany;

/**
 *
 * @author zhozho
 */
@Entity
public class PlannedMonthlyDemand extends PlannedDemand implements Serializable {
    private String monthName;
    //private MonthlySaleForecast monthlyForecast;
    private Long saleForecastA;
    private Long saleForecastB;
    private Long saleForecastC;
    private Long saleForecastD;
    
    private Long productionPlan;
    private Long productionPlanA;
    private Long productionPlanB;
    private Long productionPlanC;
    private Long productionPlanD;
    
    private Long inventoryA;
    private Long inventoryB;
    private Long inventoryC;
    private Long inventoryD;
    
    private Long numberOfWorkingDays;
    private Long capacityAB;
    private Long capacityCD;
    private Long totalCapacity;
    private Long numberofWeeks;
    private Long utilization;
    private Double breakDownA;
    private Double breakDownB;
    private Double breakDownC;
    private Double breakDownD;
    
    @OneToMany
    List<PlannedWeeklyDemand> listOfPlannedWeeklyDemand = new ArrayList<PlannedWeeklyDemand>();

    public PlannedMonthlyDemand() {
        
    }

    //TEMPORARY
    public PlannedMonthlyDemand(String monthName, Long saleForecastA, Long saleForecastB, Long saleForecastC, Long saleForecastD,
            Long productionPlan, Long inventoryA, Long inventoryB, Long inventoryC, Long inventoryD) 
    {
        this.monthName = monthName;
        this.saleForecastA = saleForecastA;
        this.saleForecastA = saleForecastB;
        this.saleForecastA = saleForecastC;
        this.saleForecastA = saleForecastD;
        
        this.productionPlan = productionPlan;
        
        this.inventoryA = inventoryA;
        this.inventoryA = inventoryB;
        this.inventoryA = inventoryC;
        this.inventoryA = inventoryD;
        
    }

    public List<PlannedWeeklyDemand> getListOfPlannedWeeklyDemand() {
        return listOfPlannedWeeklyDemand;
    }

    public void setListOfPlannedWeeklyDemand(List<PlannedWeeklyDemand> listOfPlannedWeeklyDemand) {
        this.listOfPlannedWeeklyDemand = listOfPlannedWeeklyDemand;
    }

    public String getMonthName() {
        return monthName;
    }

    public void setMonthName(String monthName) {
        this.monthName = monthName;
    }

    public Long getSaleForecastA() {
        return saleForecastA;
    }

    public void setSaleForecastA(Long saleForecastA) {
        this.saleForecastA = saleForecastA;
    }

    public Long getSaleForecastB() {
        return saleForecastB;
    }

    public void setSaleForecastB(Long saleForecastB) {
        this.saleForecastB = saleForecastB;
    }

    public Long getSaleForecastC() {
        return saleForecastC;
    }

    public void setSaleForecastC(Long saleForecastC) {
        this.saleForecastC = saleForecastC;
    }

    public Long getSaleForecastD() {
        return saleForecastD;
    }

    public void setSaleForecastD(Long saleForecastD) {
        this.saleForecastD = saleForecastD;
    }

    public Long getNumberOfWorkingDays() {
        return numberOfWorkingDays;
    }

    public void setNumberOfWorkingDays(Long numberOfWorkingDays) {
        this.numberOfWorkingDays = numberOfWorkingDays;
    }

    public Long getNumberofWeeks() {
        return numberofWeeks;
    }

    public void setNumberofWeeks(Long numberofWeeks) {
        this.numberofWeeks = numberofWeeks;
    }

    public Long getProductionPlan() {
        if (productionPlan == null) return new Long(0);
        return productionPlan;
    }

    public void setProductionPlan(Long productionPlan) {        
        this.productionPlan = productionPlan;
    }

    public Long getUtilization() {
        if (utilization == null) return new Long(-1);
        return utilization;
    }

    public void setUtilization(Long utilization) {
        if (utilization == null) this.utilization = new Long(0);
        this.utilization = utilization;
    }

    public Long getInventoryA() {
        if (inventoryA == null) return new Long(0);
        return inventoryA;
    }

    public void setInventoryA(Long inventoryA) {
        this.inventoryA = inventoryA;
    }

    public Long getTotalCapacity() {
        return totalCapacity;
    }

    public void setTotalCapacity(Long totalCapacity) {
        this.totalCapacity = totalCapacity;
    }

    public Double getBreakDownA() {
        if (breakDownA == null) return new Double (0);
        return breakDownA;
    }

    public void setBreakDownA(Double breakDownA) {
        this.breakDownA = breakDownA;
    }

    public void setCapacityAB(Long capacityAB) {
        this.capacityAB = capacityAB;
    }
    public Long getCapacityAB() {
        return capacityAB;
    }
    
    public void setCapacityCD(Long capacityCD) {
        this.capacityCD = capacityCD;
    }
    
    public Long getCapacityCD() {
        return capacityCD;
    }

    public Long getProductionPlanA() {
        return productionPlanA;
    }

    public void setProductionPlanA(Long productionPlanA) {
        this.productionPlanA = productionPlanA;
    }

    public Double getBreakDownB() {
        if (breakDownB == null) return new Double (0);
        return breakDownB;
    }

    public void setBreakDownB(Double breakDownB) {
        this.breakDownB = breakDownB;
    }

    public Double getBreakDownC() {
        if (breakDownC == null) return new Double (0);
        return breakDownC;
    }

    public void setBreakDownC(Double breakDownC) {
        this.breakDownC = breakDownC;
    }

    public Double getBreakDownD() {
        if (breakDownD == null) return new Double (0);
        return breakDownD;
    }

    public void setBreakDownD(Double breakDownD) {
        this.breakDownD = breakDownD;
    }

    public Long getInventoryB() {
        if (inventoryB == null) return new Long(0);
        return inventoryB;
    }

    public void setInventoryB(Long inventoryB) {
        this.inventoryB = inventoryB;
    }

    public Long getInventoryC() {
        if (inventoryC == null) return new Long(0);
        return inventoryC;
    }

    public void setInventoryC(Long inventoryC) {
        this.inventoryC = inventoryC;
    }

    public Long getInventoryD() {
        if (inventoryD == null) return new Long(0);
        return inventoryD;
    }

    public void setInventoryD(Long inventoryD) {
        this.inventoryD = inventoryD;
    }

    public Long getProductionPlanB() {
        return productionPlanB;
    }

    public void setProductionPlanB(Long productionPlanB) {
        this.productionPlanB = productionPlanB;
    }

    public Long getProductionPlanC() {
        return productionPlanC;
    }

    public void setProductionPlanC(Long productionPlanC) {
        this.productionPlanC = productionPlanC;
    }

    public Long getProductionPlanD() {
        return productionPlanD;
    }

    public void setProductionPlanD(Long productionPlanD) {
        this.productionPlanD = productionPlanD;
    }
    
    public Long getProductionPlan(String productName)
    {
        if(productName.compareTo("A") == 0) return getProductionPlanA();
        else if(productName.compareTo("B") == 0) return getProductionPlanB();
        else if(productName.compareTo("C") == 0) return getProductionPlanC();
        else if(productName.compareTo("D") == 0) return getProductionPlanD();
        else return new Long(-1);
    }   
    
    public Long getSaleForecast(String productName)
    {
        if(productName.compareTo("A") == 0) return getSaleForecastA();
        else if(productName.compareTo("B") == 0) return getSaleForecastB();
        else if(productName.compareTo("C") == 0) return getSaleForecastC();
        else if(productName.compareTo("D") == 0) return getSaleForecastD();
        else return new Long(-1);
    }
}
